/*
* (C) Copyright 2013 Philip Kirchhoff 
* 
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
* 
*-------------------------------------------------------------------------------
* This file is part of the DataLogger library by Philip Kirchhoff
* https://code.google.com/p/pk-data-logger/
* SVN: http://pk-data-logger.googlecode.com/svn/trunk
*-------------------------------------------------------------------------------
* Module    : DlFileHandler.h   
* Author    : Kirchhoff, Philip
* Date      : 01.04.2013
*-------------------------------------------------------------------------------
* Header file for DlFileHandler class
*   
*-------------------------------------------------------------------------------
* Change History:
* 01.04.2013  Kirchhoff 	Created
--------------------------------------------------------------------------------
*/

#ifndef DLFILEHANDLER_H
#define DLFILEHANDLER_H

#include <string>

class DlDataset;

class DlFileHandler
{
public:

    /**************************************************************************//**
    * @brief Data file format defines
    ******************************************************************************/
    typedef enum{FILE_FORMAT_CSV_STD}
    FileFormat_t;

    /**************************************************************************//**
    * @brief Constructs a Dl file handler with a specified file name
    ******************************************************************************/
    DlFileHandler(const char *fileName);

    /**************************************************************************//**
    * @brief Sets the file format of the output data file
    * @param format File format
    * \details The dafault format is DlFileWriter::FILE_FORMAT_ASCII
    ******************************************************************************/
    void setFormat(FileFormat_t format){mFileFormat = format;}

    /**************************************************************************//**
    * @brief Sets the file writers dataset
    * @param dataSet Pointer to dedicated dataset object
    ******************************************************************************/
    void setData(DlDataset *dataSet){mpDataSet = dataSet;}

    /**************************************************************************//**
    * @brief Sets the output file name
    * @param fName File name
    * \details Please note that fileName should not contain any file endings as
    *			they are appended automatically.
    ******************************************************************************/
    void setFileName(const char *fName){mFileName = std::string(fName);}

protected:

    std::string mFileName;
    DlDataset *mpDataSet;
    FileFormat_t mFileFormat;

};

#endif // DLFILEHANDLER_H
